<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>WorkPort</title>
    <link rel="stylesheet" type="text/css" href="../lib/kendo/styles/kendo.common-bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="../lib/kendo/styles/kendo.bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="../css/style.css">
    <link rel="stylesheet" type="text/css" href="../css/layout.css">
    <script src="../lib/kendo/js/jquery.min.js"></script>
    <script src="../lib/kendo/js/kendo.all.min.js"></script>
    <script src="../lib/kendo/js/jquery.transit.min.js"></script>
    <script src="../lib/jquery.slimscroll.min.js"></script>
    <script src="../js/svs.framework.js"></script>
    <script src="../js/wp.js"></script>
    <script src="../js/app.api.js"></script>
</head>

<body>
    <script type="text/javascript">
    function register(){
    	Workport.AppAPI.registerApp(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{appId:-1,title:'skype',description: 'skype software',image: 'QBEA',url: '/skype.exe',mode: 'Save',modified: true});
    }
    function home(){
    	Workport.AppAPI.getHomeApp(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{offset:'0',count:10,orderBy:'0',filterBy:'0',mode:'Limited'});
    }
    function getAll(){
    	Workport.AppAPI.getAllApp(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{offset:'0',count:10,filterBy:'0',orderBy:'0',mode:'Limited'});
    }
    function searchHome(){
    	Workport.AppAPI.searchHomeApp(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{offset:'0',count:10,key:'s',orderBy:'DESC',mode:'Contains'});
    }
    function searchAll(){
    	Workport.AppAPI.searchAllApp(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{offset:'0',count:10,key:'s',orderBy:'DESC',mode:'Contains'});
    }
    function detail(){
    	Workport.AppAPI.getDetail(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{appId:208});
    }
    function pendingCount(){
    	Workport.AppAPI.getPendingCount(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	});
    }
    function edit(){
    	Workport.AppAPI.getEditApp(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{offset:'0',count:10,sort:'ASC'});
    }
    function editDetail(){
    	Workport.AppAPI.getEditDetail(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{appId:211});
    }
    function del(){
    	Workport.AppAPI.deleteApp(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{appId:211,action:'Delete'});
    }
    function pending(){
    	Workport.AppAPI.getPendingApproval(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{pageNo:1,pageSize:10,sort:'DESC'});
    }
    function approval(){
    	Workport.AppAPI.approvalApp(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{appId:211,action:'Approve'});
    }
    function favourite(){
    	Workport.AppAPI.addFavourite(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{appId:208});
    }
    function saveLike(){
    	Workport.AppAPI.saveLike(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{appId:211});
    }
    function likedUsers(){
    	Workport.AppAPI.getLikeUser(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{appId:211,offset:'0',count:10});
    }
    function launchCount(){
    	Workport.AppAPI.postLaunchCount(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{appId:211});
    }
    function showFeedback(){
    	Workport.AppAPI.showFeedback(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{appId:211,offset:'0',count:10,type:1});
    }
    function saveFeedback(){
    	Workport.AppAPI.saveFeedback(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{appId:211,feedback:'very good',ratings:5});
    }
    function editCount(){
    	Workport.AppAPI.getStatus(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	});
    }
    function clearLog(){
    	$('#result').get(0).innerText = "";
    }
    </script>
    
</body>
	<input type = "button" onclick = "clearLog()" value="Clear"></br>
	<input type = "button" onclick = "register()" value="Register">
	<input type = "button" onclick = "home()" value="Home">
	<input type = "button" onclick = "getAll()" value="All">
	<input type = "button" onclick = "searchHome()" value="SearchHome">
	<input type = "button" onclick = "searchAll()" value="SearchAll">
	<input type = "button" onclick = "detail()" value="Detail">
	<input type = "button" onclick = "pendingCount()" value="PendingCount">
	<input type = "button" onclick = "edit()" value="Edit">
	<input type = "button" onclick = "editDetail()" value="EditDetail">
	<input type = "button" onclick = "del()" value="Delete">
	<input type = "button" onclick = "pending()" value="Pending">
	<input type = "button" onclick = "approval()" value="Approval">
	<input type = "button" onclick = "favourite()" value="Favourite">
	<input type = "button" onclick = "saveLike()" value="SaveLike">
	<input type = "button" onclick = "likedUsers()" value="LikedUsers">
	<input type = "button" onclick = "launchCount()" value="LaunchCount">
	<input type = "button" onclick = "showFeedback()" value="ShowFeedback">
	<input type = "button" onclick = "saveFeedback()" value="SaveFeedback">
	<input type = "button" onclick = "editCount()" value="EditCount">
	</br>
	
	<div id="result" style="margin: 0px;"></div>
	
</html>